import { IObject } from '@/components/core/dynamic-table/helper';

export const clearFormValidation = (form: IObject) => {
  Object.keys(form).forEach(key => {
    if (typeof form[key] === 'number' || typeof form[key] === 'string') {
      form[key] = '';
    } else if (Array.isArray(form[key])) {
      form[key] = [];
    } else if (typeof form[key] === 'object') {
      clearFormValidation(form[key]);
    }
  });
};
